package com.platform.qujia.service.impl;

import com.platform.qujia.service.WxTemplateParamsGeneral;
import org.springframework.stereotype.Component;

import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Component("IntegralChange")
public class IntegralChangeParams implements WxTemplateParamsGeneral {
    @Override
    public void setWxTemplateContent(List<String> contents, Map<String, String> templateParams, Map<String, Map<String, String>> data) {

        if(contents.contains("油站名称")){
            data.put("thing1", Collections.singletonMap("value", templateParams.get("stationName")));
        }
        if (contents.contains("变动时间")) {
            data.put("time6", Collections.singletonMap("value", templateParams.get("createTime")));
        }
        if (contents.contains("积分变动")) {
            data.put("thing10", Collections.singletonMap("value", "积分"+templateParams.get("integral")));
        }
        if (contents.contains("积分余额")) {
            //data.put("character_string7", Collections.singletonMap("value", "Lv1"));
            data.put("thing9", Collections.singletonMap("value", "积分余额："+templateParams.get("totalIntegral")));
        }
    }
}
